import { Entity, Column, ManyToOne } from "typeorm";
import { BaseEntity } from "../base.entity";
import { Order } from "../order/Order.entity";
// 购物车 单条商品信息
@Entity()
export class Cart extends BaseEntity {
  goods: any;

  @Column({ comment: "商品id" })
  goods_id: string;

  @Column({ comment: "商品数量" })
  goods_num: number;

  @Column({ comment: "用户id" })
  user_id: string;

  // @Column({ default: "", comment: "订单id" })
  // order_id: string;

  @Column({
    default: "1",
    length: 2,
    comment: "状态 1 正常 2 已添加订单",
  })
  status: string;

  // 订单id
  @ManyToOne(() => Order, (order) => order.carts)
  order: Order;
}
